/**
 * Created by Administrator on 2015/11/27.
 */
var Q = require('q');
function mySetTimeout(seconds){
    var defered = Q.defer();
    setTimeout(function(){
        defered.resolve('done');
    },seconds*1000)
    return defered.promise;
}
mySetTimeout(1).then(function(data){
    console.log('one second is timeout');
    return mySetTimeout(2);
}).then(function(data){
    console.log('two seconds is timeout');
})
